import request from '@/utils/request'

export function findFiles(query) {
  return request({
  baseURL: 'http://localhost:8886',
    url:  '/file/findAll2',
    method: 'get',
      params: query
  })
}

export function searchFiles(searchname) {
  return request({
  baseURL: 'http://localhost:8886',
    url:  '/file/search',
    method: 'get',
  params: { searchname }
  })
}

export function getUpdate(data) {
  return request({
    baseURL: 'http://localhost:8886',
    url: '/file/update',
    method: 'post',
    data
  })
}

export function delFile(query) {
  return request({
  baseURL: 'http://localhost:8886',
    url:  '/file/del',
    method: 'get',
    params: query
  })
}

export function getFiles() {
  return request({
    baseURL: 'http://localhost:8886',
    url:  '/file/findAllFiles',
    method: 'get'
  })
}

export function getAdd(data) {
  return request({
    baseURL: 'http://localhost:8886',
    url: '/file/add',
    method: 'post',
    data
  })
}
